<script>
	import {
		mapState,
		mapMutations
	} from 'vuex'
	export default {
		onLaunch: function() {
			console.log('App Launch')
			// 如果用户已经初始化 不再进入启动页
			// const flag = uni.getStorageSync('flag')
			// if (flag == 1) {
			// 	uni.switchTab({
			// 		url: '/pages/index/index'
			// 	})
			// }
			if (this.ceshidata) {
				uni.switchTab({
					url: '/pages/index/index'
				})
			}
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
			// 如果用户已经初始化 本地记录
			// uni.setStorageSync('flag', 1)
			this.ceshi(true)
		},
		onExit() {
			console.log('App onExit')
			// uni.setStorageSync('flag', 1)
			this.ceshi(true)
		},
		computed: {
			...mapState(['ceshidata'])
		},
		methods: {
			...mapMutations(['ceshi'])
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import "@/uni_modules/uview-ui/index.scss";
	@import "@/common/css/common.css";
	/* @import "@/static/font/iconfont.css"; */
</style>